
#include "tstack.h"

#include <iostream>

template<class T>TStack<T>::TStack(){
	this->length=20;
	this->t=new T[length];
	this->level=-1;
}
template<class T>TStack<T>::~TStack(){

	delete t;
}
template<class T>TStack<T>::TStack(int length){
	this->length=length;
	this->t=new T[length];
	this->level=1;
}
template <class T>void TStack<T>::add(T element){
	if(this->full()){
	
	}
	else{
	++level;
	t[level]=element;
	 }
	
}
template<class T>void TStack<T>::print(){
	if(this->empty()){
	}
	else{
        std::cout<<std::endl<<"Stiva:";
	for(int i=0;i<=this->level;i++)
		std::cout<<"\n"<<t[i];
	}
}
template<class T>bool TStack<T>::empty(){
	if(this->level==0)
		return true;
	return false;
}
template<class T>bool TStack<T>::full(){
	if(this->level==this->length)
	return true;
		
	return false;
}


